//
//  HBRankItemCell.m
//  HeartBeat
//
//  Created by karong on 2023/8/25.
//

#import "HBRankItemCell.h"

@interface HBRankItemCell ()
@property (weak, nonatomic) IBOutlet UILabel *finishLabel;
@property (weak, nonatomic) IBOutlet UIImageView *rankImageView;
@property (weak, nonatomic) IBOutlet UILabel *scoreLabel;
@property (weak, nonatomic) IBOutlet UILabel *rankLabel;
@end

@implementation HBRankItemCell
- (void)setDataWithObject:(HBNovelModel *)object index:(NSInteger)index {
    [super setDataWithObject:object];
    self.finishLabel.text = object.finish_txt;
    if (index > 2) {
        self.rankLabel.hidden = NO;
        self.rankLabel.text = SF(@"%ld", (long)index+1);
        self.rankImageView.hidden = YES;
    }
    else {
        self.rankLabel.hidden = YES;
        self.rankImageView.hidden = NO;
        self.rankImageView.image = IMG(SF(@"icon_rank_%ld", (long)index));
    }
    self.scoreLabel.text = SF(@"%.1f",object.score);
}
@end
